package com.ymatou.iapi.pushbind.service;

import com.google.common.reflect.TypeToken;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;

import java.util.List;

/**
*获取所有绑定客户端Call
*FreeMaker Template自动生成代码
*/
public class GetAllBindClientCall extends YmatouBaseCall{
	private static String opurl ="api/Push/GetAllBindClient";
	
	public GetAllBindClientCall() {
		super(EnvSetup.getSystemUrl("pushbind_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<String> getclientIds(){
		String clientIds=getJsonObject().get("Result").getAsJsonObject().get("clientIds").getAsJsonArray().toString();
		List<String> clientIdsList=(List<String>) FormatUtil.GSONToObject(clientIds, new TypeToken<List<String>>(){}.getType());
		return clientIdsList;
	}

}